﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Forums.Domain.Services
{
	using System.Collections.Generic;
	using Falcon.Core.Collections;
	using Falcon.Forums.Domain.Enums;
	using Falcon.Forums.Domain.Values;

	public interface IForumPostService
	{
		/// <summary>
		/// Gets the forum post by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		/// <returns></returns>
		ForumPost GetBy(ForumPostSpecification specification);

		/// <summary>
		/// Gets the forum post by id.
		/// </summary>
		/// <param name="id">The id.</param>
		ForumPost GetById(int id);

		/// <summary>
		/// Gets all the forum posts by the specified specification.
		/// </summary>
		/// <param name="specification">The specification.</param>
		IPagedList<ForumPost, ForumPostSpecification> GetPaged(ForumPostSpecification specification);

		/// <summary>
		/// Creates the forum post.
		/// </summary>
		ForumPost Create();

		/// <summary>
		/// Inserts the forum post into the storage.
		/// </summary>
		/// <param name="post">The <see cref="ForumPost"/>.</param>
		void Insert(ForumPost post);

		/// <summary>
		/// Inserts the specified post.
		/// </summary>
		/// <param name="post">The post.</param>
		/// <param name="value">The value.</param>
		void Insert(ForumPost post, ForumPostCreate value);

		/// <summary>
		/// Updates the specified post.
		/// </summary>
		/// <param name="post">The post.</param>
		void Update(ForumPost post);

		/// <summary>
		/// Updates the specified post.
		/// </summary>
		/// <param name="post">The post.</param>
		/// <param name="value">The value.</param>
		void Update(ForumPost post, ForumPostUpdate value);

		/// <summary>
		/// Updates the specified posts.
		/// </summary>
		/// <param name="posts">The posts.</param>
		/// <param name="action">The action.</param>
		void Update(IList<ForumPost> posts, ForumPostAction action);

		/// <summary>
		/// Deletes the specified posts.
		/// </summary>
		/// <param name="posts">The posts.</param>
		/// <param name="reason">The reason.</param>
		void Delete(IList<ForumPost> posts, string reason);

		/// <summary>
		/// Deletes the specified post.
		/// </summary>
		/// <param name="post">The post.</param>
		void Delete(ForumPost post);

		/// <summary>
		/// Deletes the posts specified in <see cref="ForumPostDelete"/>.
		/// </summary>
		/// <param name="value">The value.</param>
		void Delete(ForumPostDelete value);

		/// <summary>
		/// Deletes the posts specified in <see cref="ForumPostDeleteSpam"/>.
		/// </summary>
		/// <param name="value">The value.</param>
		void Delete(ForumPostDeleteSpam value);

		/// <summary>
		/// Moves the posts specified in <see cref="ForumPostMove"/>.
		/// </summary>
		/// <param name="value">The value.</param>
		void Move(ForumPostMove value);

		/// <summary>
		/// Merges the posts specified in <see cref="ForumPostMerge"/>.
		/// </summary>
		/// <param name="merge">The merge.</param>
		void Merge(ForumPostMerge merge);

		/// <summary>
		/// Copies the posts specified in <see cref="ForumPostCopy"/>.
		/// </summary>
		/// <param name="copy">The copy.</param>
		void Copy(ForumPostCopy copy);

		/// <summary>
		/// Transforms the specified values that are selected to the posts list.
		/// </summary>
		/// <param name="values">The values.</param>
		/// <param name="posts">The posts.</param>
		void Transform(ForumPostUpdateValues[] values, IList<ForumPost> posts);
	}
}